package cn.iocoder.yudao.module.system.dal.mysql.expert;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.system.dal.dataobject.expert.ExpertDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.system.controller.admin.expert.vo.*;

/**
 * 专家 Mapper
 *
 * @author 芋道源码
 */
@Mapper
public interface ExpertMapper extends BaseMapperX<ExpertDO> {

    default PageResult<ExpertDO> selectPage(ExpertPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<ExpertDO>()
                .betweenIfPresent(ExpertDO::getCreateTime, reqVO.getCreateTime())
                .eqIfPresent(ExpertDO::getType, reqVO.getType())
                .eqIfPresent(ExpertDO::getLevel, reqVO.getLevel())
                .likeIfPresent(ExpertDO::getName, reqVO.getName())
                .eqIfPresent(ExpertDO::getRemark, reqVO.getRemark())
                .eqIfPresent(ExpertDO::getPoints, reqVO.getPoints())
                .orderByDesc(ExpertDO::getId));
    }

}